package com.shop.entity;

// Generated 2015-10-7 22:59:34 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * Shop generated by hbm2java
 */
@Entity
@Table(name = "shop", catalog = "shop", uniqueConstraints = @UniqueConstraint(columnNames = "cust_id"))
public class Shop implements java.io.Serializable {

	private Integer shopId;
	private Customer customer;
	private FirstClass firstClass;
	private String shopUuid;
	private String shopInfo;
	private String shopAddr;
	private String shopTele;
	private String shopName;
	private int shopFollowers;
	private Date shopDate;
	private boolean shopEnabled;
	private int shopProductNum;
	private Date shopLastprom;
	private Date shopLastprod;
	private Set<ShopClass> shopClasses = new HashSet<ShopClass>(0);
	private Set<Collect> collects = new HashSet<Collect>(0);
	private Set<Tempalte> tempaltes = new HashSet<Tempalte>(0);
	private Set<PictureRelate> pictureRelates = new HashSet<PictureRelate>(0);
	private Set<Product> products = new HashSet<Product>(0);

	public Shop() {
	}
	
	public Shop(Shop shop) {
		this.shopId = shop.getShopId();
		this.customer = shop.getCustomer();
		this.shopUuid = shop.getShopUuid();
		this.shopInfo = shop.getShopInfo();
		this.shopAddr = shop.getShopAddr();
		this.shopTele = shop.getShopTele();
		this.shopName = shop.getShopName();
		this.shopFollowers = shop.getShopFollowers();
		this.shopDate = shop.getShopDate();
		this.shopEnabled = shop.isShopEnabled();
		this.shopProductNum = shop.getShopProductNum();
	}

	public Shop(Customer customer, String shopUuid, String shopInfo,
			String shopAddr, String shopTele, String shopName,
			int shopFollowers, Date shopDate, boolean shopEnabled,
			int shopProductNum) {
		this.customer = customer;
		this.shopUuid = shopUuid;
		this.shopInfo = shopInfo;
		this.shopAddr = shopAddr;
		this.shopTele = shopTele;
		this.shopName = shopName;
		this.shopFollowers = shopFollowers;
		this.shopDate = shopDate;
		this.shopEnabled = shopEnabled;
		this.shopProductNum = shopProductNum;
	}

	public Shop(Customer customer, FirstClass firstClass, String shopUuid,
			String shopInfo, String shopAddr, String shopTele, String shopName,
			int shopFollowers, Date shopDate, boolean shopEnabled,
			int shopProductNum, Date shopLastprom, Date shopLastprod,
			Set<ShopClass> shopClasses, Set<Collect> collects,
			Set<Tempalte> tempaltes, Set<PictureRelate> pictureRelates,
			Set<Product> products) {
		this.customer = customer;
		this.firstClass = firstClass;
		this.shopUuid = shopUuid;
		this.shopInfo = shopInfo;
		this.shopAddr = shopAddr;
		this.shopTele = shopTele;
		this.shopName = shopName;
		this.shopFollowers = shopFollowers;
		this.shopDate = shopDate;
		this.shopEnabled = shopEnabled;
		this.shopProductNum = shopProductNum;
		this.shopLastprom = shopLastprom;
		this.shopLastprod = shopLastprod;
		this.shopClasses = shopClasses;
		this.collects = collects;
		this.tempaltes = tempaltes;
		this.pictureRelates = pictureRelates;
		this.products = products;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "shop_id", unique = true, nullable = false)
	public Integer getShopId() {
		return this.shopId;
	}

	public void setShopId(Integer shopId) {
		this.shopId = shopId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cust_id", unique = true, nullable = false)
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "fist_class_id")
	public FirstClass getFirstClass() {
		return this.firstClass;
	}

	public void setFirstClass(FirstClass firstClass) {
		this.firstClass = firstClass;
	}

	@Column(name = "shop_uuid", nullable = false, length = 32)
	public String getShopUuid() {
		return this.shopUuid;
	}

	public void setShopUuid(String shopUuid) {
		this.shopUuid = shopUuid;
	}

	@Column(name = "shop_info", nullable = false, length = 500)
	public String getShopInfo() {
		return this.shopInfo;
	}

	public void setShopInfo(String shopInfo) {
		this.shopInfo = shopInfo;
	}

	@Column(name = "shop_addr", nullable = false, length = 100)
	public String getShopAddr() {
		return this.shopAddr;
	}

	public void setShopAddr(String shopAddr) {
		this.shopAddr = shopAddr;
	}

	@Column(name = "shop_tele", nullable = false, length = 32)
	public String getShopTele() {
		return this.shopTele;
	}

	public void setShopTele(String shopTele) {
		this.shopTele = shopTele;
	}

	@Column(name = "shop_name", nullable = false, length = 100)
	public String getShopName() {
		return this.shopName;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	@Column(name = "shop_followers", nullable = false)
	public int getShopFollowers() {
		return this.shopFollowers;
	}

	public void setShopFollowers(int shopFollowers) {
		this.shopFollowers = shopFollowers;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "shop_date", nullable = false, length = 19)
	public Date getShopDate() {
		return this.shopDate;
	}

	public void setShopDate(Date shopDate) {
		this.shopDate = shopDate;
	}

	@Column(name = "shop_enabled", nullable = false)
	public boolean isShopEnabled() {
		return this.shopEnabled;
	}

	public void setShopEnabled(boolean shopEnabled) {
		this.shopEnabled = shopEnabled;
	}

	@Column(name = "shop_product_num", nullable = false)
	public int getShopProductNum() {
		return this.shopProductNum;
	}

	public void setShopProductNum(int shopProductNum) {
		this.shopProductNum = shopProductNum;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "shop_lastprom", length = 19)
	public Date getShopLastprom() {
		return this.shopLastprom;
	}

	public void setShopLastprom(Date shopLastprom) {
		this.shopLastprom = shopLastprom;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "shop_lastprod", length = 19)
	public Date getShopLastprod() {
		return this.shopLastprod;
	}

	public void setShopLastprod(Date shopLastprod) {
		this.shopLastprod = shopLastprod;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "shop")
	public Set<ShopClass> getShopClasses() {
		return this.shopClasses;
	}

	public void setShopClasses(Set<ShopClass> shopClasses) {
		this.shopClasses = shopClasses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "shop")
	public Set<Collect> getCollects() {
		return this.collects;
	}

	public void setCollects(Set<Collect> collects) {
		this.collects = collects;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "shop")
	public Set<Tempalte> getTempaltes() {
		return this.tempaltes;
	}

	public void setTempaltes(Set<Tempalte> tempaltes) {
		this.tempaltes = tempaltes;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "shop")
	public Set<PictureRelate> getPictureRelates() {
		return this.pictureRelates;
	}

	public void setPictureRelates(Set<PictureRelate> pictureRelates) {
		this.pictureRelates = pictureRelates;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "shop")
	public Set<Product> getProducts() {
		return this.products;
	}

	public void setProducts(Set<Product> products) {
		this.products = products;
	}

}
